<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>学术助手 - 论文工具搜索导航</title>
  
  <!-- 外部CSS库 -->
  <script src="https://cdn.tailwindcss.com"></script>
  <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
  
  <!-- 自定义CSS -->
  <link rel="stylesheet" href="css/style.css">
  
  <!-- Tailwind 配置 -->
  <script src="js/tailwind-config.js"></script>
  
  <!-- 共用导航栏组件 -->
  <script src="js/navbar.js"></script>
</head>
<body class="bg-gradient-to-br from-light to-gray-100 font-inter min-h-screen flex flex-col">
  
  <!-- 查看更多模态框 -->
  <div id="category-modal" class="fixed inset-0 bg-black bg-opacity-50 z-[60] hidden backdrop-blur-sm" style="display: flex; align-items: center; justify-content: center; padding: 2rem;">
    <div class="bg-white rounded-2xl shadow-2xl max-w-4xl w-full overflow-hidden animate-modal-in flex flex-col" style="max-height: calc(100vh - 4rem);">
      <!-- 模态框头部 (固定) -->
      <div class="flex-shrink-0 bg-gradient-to-r from-blue-500 to-indigo-600 px-6 py-4 flex items-center justify-between">
        <div class="flex items-center">
          <div id="modal-icon-container" class="w-12 h-12 rounded-xl bg-white bg-opacity-20 flex items-center justify-center mr-4">
            <i id="modal-icon" class="fa fa-database text-white text-2xl"></i>
          </div>
          <div>
            <h3 id="modal-title" class="text-2xl font-bold text-white">学术库</h3>
            <p id="modal-count" class="text-sm text-white text-opacity-80">共 10 个资源</p>
          </div>
        </div>
        <button id="close-modal" class="w-10 h-10 rounded-full bg-white bg-opacity-20 hover:bg-opacity-30 flex items-center justify-center transition-all">
          <i class="fa fa-times text-white text-xl"></i>
        </button>
      </div>
      
      <!-- 搜索框 (固定) -->
      <div class="flex-shrink-0 px-6 py-4 bg-white border-b border-gray-100">
        <div class="relative">
          <i class="fa fa-search absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
          <input 
            type="text" 
            id="modal-search" 
            placeholder="在当前分类中搜索..." 
            class="w-full pl-12 pr-4 py-3 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"
          />
        </div>
      </div>
      
      <!-- 资源列表 (可滚动区域) -->
      <div id="modal-content" class="flex-1 overflow-y-auto p-6">
        <!-- 资源卡片网格 -->
        <div id="modal-resources-grid" class="grid grid-cols-1 md:grid-cols-2 gap-4">
          <!-- 资源项将通过JavaScript动态生成 -->
        </div>
        
        <!-- 空状态 -->
        <div id="modal-empty" class="hidden text-center py-12">
          <i class="fa fa-inbox text-gray-300 text-6xl mb-4"></i>
          <p class="text-gray-500 text-lg">未找到相关资源</p>
        </div>
      </div>
      
      <!-- 底部统计 (固定) -->
      <div class="flex-shrink-0 bg-gray-50 px-6 py-3 border-t border-gray-200 flex items-center justify-between">
        <div class="text-sm text-gray-600">
          <span>显示 </span>
          <span id="modal-showing-count" class="font-semibold text-blue-600">0</span>
          <span> / </span>
          <span id="modal-total-count" class="font-semibold">0</span>
          <span> 个资源</span>
        </div>
        <button id="close-modal-btn" class="px-6 py-2 bg-gray-200 hover:bg-gray-300 text-gray-700 rounded-lg font-medium transition-all">
          关闭
        </button>
      </div>
    </div>
  </div>
  
  <!-- 导航栏将通过 navbar.js 动态加载 -->

  <!-- 主要内容 -->
  <main class="flex-grow container mx-auto px-4 py-8">
    <!-- 搜索区域 -->
    <section id="resources" class="max-w-4xl mx-auto mb-12">
      <div class="text-center mb-8">
        <!-- ========== 轮播胶囊图 开始 ========== -->
        <!-- 可以注释这整块来隐藏轮播图 -->
        <div class="flex justify-center mb-6">
          <div id="carousel-capsule" class="relative overflow-hidden rounded-full shadow-lg" style="width: 420px; height: 60px;">
            <!-- 轮播项容器 -->
            <div id="carousel-track" class="flex transition-transform duration-500 ease-in-out h-full">
              <!-- 轮播项 1 -->
              <div class="carousel-item flex-shrink-0 flex items-center justify-center px-6" style="width: 420px; height: 60px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
                <i class="fa fa-gift text-white text-2xl mr-3"></i>
                <span class="text-white font-bold text-lg">🎉 新用户福利：免费领取学术资源大礼包</span>
              </div>
              
              <!-- 轮播项 2 -->
              <div class="carousel-item flex-shrink-0 flex items-center justify-center px-6" style="width: 420px; height: 60px; background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
                <i class="fa fa-star text-white text-2xl mr-3"></i>
                <span class="text-white font-bold text-lg">⭐ 精选推荐：顶级学术数据库限时开放</span>
              </div>
              
              <!-- 轮播项 3 -->
              <div class="carousel-item flex-shrink-0 flex items-center justify-center px-6" style="width: 420px; height: 60px; background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">
                <i class="fa fa-rocket text-white text-2xl mr-3"></i>
                <span class="text-white font-bold text-lg">🚀 AI写作助手：让论文创作更轻松</span>
              </div>
            </div>
            
            <!-- 指示器 -->
            <div class="absolute bottom-2 left-1/2 transform -translate-x-1/2 flex space-x-2 z-10">
              <div class="carousel-indicator w-2 h-2 rounded-full bg-white opacity-50 cursor-pointer transition-all" data-index="0"></div>
              <div class="carousel-indicator w-2 h-2 rounded-full bg-white opacity-50 cursor-pointer transition-all" data-index="1"></div>
              <div class="carousel-indicator w-2 h-2 rounded-full bg-white opacity-50 cursor-pointer transition-all" data-index="2"></div>
            </div>
          </div>
        </div>
        <!-- ========== 轮播胶囊图 结束 ========== -->
        
        <h2 class="text-[clamp(2rem,5vw,3.5rem)] font-bold text-dark mb-3">学术资源<span class="text-primary">一站式</span>导航</h2>
        <p class="text-gray-600 text-lg max-w-2xl mx-auto">汇集全球优质学术资源，助您高效完成研究工作</p>
      </div>
      
      <!-- 公告通知组件 -->
      <div id="announcement-banner" class="bg-yellow-100 border border-yellow-200 rounded-lg py-2 px-4 mb-6 max-w-4xl mx-auto overflow-hidden">
        <div class="flex items-center">
          <i class="fa fa-bullhorn text-yellow-600 mr-2 flex-shrink-0"></i>
          <div class="marquee-container flex-1">
            <div class="marquee-content whitespace-nowrap text-yellow-800 text-sm font-medium">
              🎉 欢迎使用学术助手！新增AI论文写作助手功能，助您高效完成学术研究 | 📚 本周新增100+优质学术资源 | 🔥 热门推荐：ChatGPT学术版、Grammarly、Zotero文献管理工具
            </div>
          </div>
          <button id="close-announcement" class="text-yellow-600 hover:text-yellow-800 ml-2 flex-shrink-0 transition-colors" title="关闭公告">
            <i class="fa fa-times"></i>
          </button>
        </div>
      </div>
      
      <!-- 搜索框 -->
      <div class="relative mb-8 shadow-soft rounded-2xl hover-scale search-container">
        <div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
          <i class="fa fa-search text-gray-400 text-xl"></i>
        </div>
        <input type="text" id="search-input" placeholder="搜索论文网站、工具或资源..." 
               class="block w-full pl-12 pr-40 py-5 bg-white border-0 focus:ring-2 focus:ring-primary/50 text-lg rounded-2xl overflow-hidden"
               autocomplete="off">
        <div class="absolute inset-y-0 right-0 flex items-center">
          <button id="search-button" class="bg-primary hover:bg-primary/90 text-white px-6 py-5 rounded-r-2xl transition-all-300 flex items-center">
            <span class="mr-2">搜索</span>
            <i class="fa fa-arrow-right"></i>
          </button>
        </div>
        
        <!-- 搜索下拉建议框 -->
        <div id="search-dropdown" class="hidden absolute top-full left-0 right-0 z-40 bg-white border border-gray-200 rounded-2xl shadow-lg mt-1">
          <div id="search-results-container" class="py-2">
            <!-- 搜索结果将在这里动态显示 -->
          </div>
          <div id="no-results" class="hidden py-8 text-center text-gray-500">
            <i class="fa fa-search text-gray-300 text-3xl mb-2"></i>
            <p>未找到相关资源</p>
          </div>
        </div>
      </div>
      
      <!-- 分类导航区域 -->
      <div id="category-navigation" class="grid grid-cols-1 md:grid-cols-3 gap-6 max-w-5xl mx-auto">
        <!-- 分类导航将通过JavaScript动态加载 -->
      </div>
      </div>
    </section>
    
    <!-- 搜索结果区域 (已改为下拉形式，此区域不再使用) -->
    <section id="search-results-section" class="bg-white rounded-2xl shadow-soft p-6 mb-12 max-w-5xl mx-auto hidden" style="display: none;">
      <div class="flex justify-between items-center mb-6">
        <h2 class="text-xl font-bold text-dark">学术资源导航</h2>
        <div class="flex items-center space-x-2">
          <span class="text-gray-500">找到 <span id="result-count" class="text-primary font-semibold">10</span> 个资源</span>
          <div class="relative">
            <select class="appearance-none bg-gray-100 border-0 rounded-lg py-2 pl-4 pr-10 text-sm focus:outline-none focus:ring-2 focus:ring-primary/50">
              <option>默认排序</option>
              <option>按名称</option>
            </select>
            <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-500">
              <i class="fa fa-chevron-down text-xs"></i>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 筛选器 -->
      <div class="flex flex-wrap gap-3 mb-6 pb-4 border-b">
        <button class="filter-btn px-4 py-2 rounded-full bg-primary text-white text-sm font-medium">全部</button>
        <button class="filter-btn px-4 py-2 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm font-medium transition-all-300">论文数据库</button>
        <button class="filter-btn px-4 py-2 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm font-medium transition-all-300">论文写作</button>
        <button class="filter-btn px-4 py-2 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm font-medium transition-all-300">数据分析</button>
        <button class="filter-btn px-4 py-2 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm font-medium transition-all-300">翻译工具</button>
        <button class="filter-btn px-4 py-2 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm font-medium transition-all-300">学术社交</button>
      </div>
      
      <!-- 资源表格 -->
      <div class="overflow-x-auto max-w-5xl mx-auto">
        <table class="w-full divide-y divide-gray-200">
          <thead>
            <tr>
              <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">资源名称</th>
              <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
            </tr>
          </thead>
          <tbody class="bg-white divide-y divide-gray-200" id="resource-table-body">
            <!-- 表格内容将通过JS动态加载 -->
          </tbody>
        </table>
      </div>
      
      <!-- 分页 -->
      <div class="flex items-center justify-between pt-6">
        <div class="flex-1 flex justify-between sm:hidden">
          <button class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
            上一页
          </button>
          <button class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
            下一页
          </button>
        </div>
        <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
          <div>
            <p class="text-sm text-gray-700">
              显示第 <span class="font-medium">1</span> 到 <span class="font-medium">10</span> 条，共 <span class="font-medium">10</span> 条结果
            </p>
          </div>
          <div>
            <nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
              <button class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
                <span class="sr-only">上一页</span>
                <i class="fa fa-chevron-left text-xs"></i>
              </button>
              <button aria-current="page" class="z-10 bg-primary text-white relative inline-flex items-center px-4 py-2 border border-primary text-sm font-medium">1</button>
              <button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">2</button>
              <button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">3</button>
              <span class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700">
                ...
              </span>
              <button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">12</button>
              <button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">13</button>
              <button class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
                <span class="sr-only">下一页</span>
                <i class="fa fa-chevron-right text-xs"></i>
              </button>
            </nav>
          </div>
        </div>
      </div>
    </section>
    


  <!-- JavaScript 模块文件 -->
  <script src="js/config.js"></script>
  <script src="js/modules/constants.js"></script>
  <script src="js/modules/utils.js"></script>
  <script src="js/modules/api.js"></script>
  <script src="js/modules/ui.js"></script>
  <script src="js/modules/search.js"></script>
  <script src="js/app.js"></script>
</body>
</html>